package jtk.project4.fleet.field;

import jtk.project4.fleet.domain.Equipment;
import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.ImageField;
import nl.coderight.jazz.form.field.TextField;
import nl.coderight.jazz.form.field.button.PushButton;

public class EquipmentPhotoPhotoField extends GroupControl<Equipment>{
	private ImageField photoField;
	private PushButton addButton;
	private PushButton deleteButton;
	private PushButton viewButton;

	public EquipmentPhotoPhotoField(String bindID){
		setTitle("header.photo");
		setBindID(bindID);
		createFields();
		addField(createLayout());
	}
	
	private void createFields(){
		photoField = new ImageField();
		addButton = new PushButton("button.add");
		deleteButton = new PushButton("button.delete");
		viewButton = new PushButton("button.view");
	}
	
	private GroupControl createLayout() {
		GroupControl form = new GroupControl();
		form.setLayout(new FormLayout())
		.addField(photoField) .addLabel("")
		.addRow()
		.addField(createButton());
		;
		return form;
	}
	
	private GroupControl createButton(){
		GroupControl form = new GroupControl();
		form.setLayout(new FormLayout())
		.addField(addButton)
		.addField(deleteButton) 
		.addField(viewButton) 
		;
		return form;
	}
	

	
}